// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 商品管理详情 GET /supplyChain/goods/${param0} */
export async function detail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detailParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseSupplyChainGoodsInfoVo>(
    `/barter-goods/supplyChain/goods/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 修改价格 PUT /supplyChain/goods/${param0} */
export async function editPrice(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.editPriceParams,
  body: API.SupplyChainEditGoodsPriceDto,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-goods/supplyChain/goods/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 设置销量 PUT /supplyChain/goods/goods/sales/${param0} */
export async function selection(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: any,
  body: any,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-goods/supplyChain/goods`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 商品管理分页 GET /supplyChain/goods/list */
export async function listPage(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listPageParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageRespSupplyChainGoodsInfoVo>(
    `/barter-goods/supplyChain/goods/list`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
